home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CBASE102.ARJ / CBGETLCK.C < prev    next >
Text File  |  1991-09-23  |  1KB  |  51 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "@(#)cbgetlck.c    1.5 - 91/09/23" */
  5.  
  6. #include <ansi.h>
  7.  
  8. /* local headers */
  9. #include "cbase_.h"
  10.  
  11. /*man---------------------------------------------------------------------------
  12. NAME
  13.      cbgetlck - get cbase lock status
  14.  
  15. SYNOPSIS
  16.      #include <cbase.h>
  17.  
  18.      int cbgetlck(cbp)
  19.      cbase_t *cbp;
  20.  
  21. DESCRIPTION
  22.      The cbgetlck function reports the lock status of cbase cbp.  The
  23.      function returns the status of the lock currently held by the
  24.      calling process.  Locks held by other processes are not reported.
  25.  
  26.      The possible return values are:
  27.  
  28.      CB_UNLCK       cbase not locked
  29.      CB_RDLCK       cbase locked for reading
  30.      CB_WRLCK       cbase locked for reading and writing
  31.  
  32. SEE ALSO
  33.      cblock.
  34.  
  35. ------------------------------------------------------------------------------*/
  36. #ifdef AC_PROTO
  37. int cbgetlck(cbase_t *cbp)
  38. #else
  39. int cbgetlck(cbp)
  40. cbase_t *cbp;
  41. #endif
  42. {
  43.     if (!(cbp->flags & CBLOCKS)) {
  44.         return CB_UNLCK;
  45.     } else if (cbp->flags & CBWRLCK) {
  46.         return CB_WRLCK;
  47.     }
  48.  
  49.     return CB_RDLCK;
  50. }
  51.